<template>
  <view class="video-item" @click="handleDetail(item)">
    <u-image :src="prefixURL(item.image||item.cover_img)" width="346rpx" height="386rpx"></u-image>
    <view class="video-text ">
      <view class="u-line-1">{{item.title}}</view>
    </view>
    <slot></slot>
  </view>
</template>

<script setup>
  import {
    useAttrs
  } from 'vue';
  import { prefixURL } from '../../util/util';
  const $attrs = useAttrs()
  const props = defineProps({
    item: {
      type: Object,
      default: () => {}
    }
  })
  const handleDetail = (item) => {
    if ($attrs['page']) {
      uni.$u.route($attrs['page'])
    } else {
      uni.$u.route(`/pages/index/houseLive/houseVideo?id=${item.id}`)
    }
  }
</script>

<style lang="scss">
  .video-item {
    background: #fff;
    border-radius: 24rpx;
    overflow: hidden;
    margin-top: 20rpx;
    width: 346rpx;

    .video-text {
      padding: 16rpx;
      font-size: 24rpx;
      color: #000;
    }
  }
</style>